package edu.sctu.practice.class02.yangyuran.test08;

/**
 * Created by Administrator on 2015/10/12.
 */
public class Vehicles {
    public String brand;
    public String color;

    public Vehicles() {
        this.brand = "奔驰";
        this.color = "蓝色";
    }

    public void run() {
        System.out.println("我已经开动了");
    }

    public void showInfo() {
        System.out.println("商标为：" + brand + "  " + "颜色为：" + color);
    }


    public static class Car extends Vehicles {
        public int seats;

        public Car() {
            this.seats = 5;
        }

        public void showCar() {
            System.out.println("小车的商标为：" + brand + "  " + "颜色为：" + color + "  " + "载客量为：" + seats);
        }
    }

    public static class Truck extends Vehicles {
        public float load;

        public Truck() {
            this.load = 10;
        }

        public void showTruck() {
            System.out.println("卡车的商标为：" + brand + "  " + "颜色为：" + color + "  " + "载重量为：" + load + "吨");
        }
    }

    public static void main(String[] args) {

        Car car = new Car();
        car.showCar();
        Truck truck = new Truck();
        truck.showTruck();
    }

}
